<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="java.sql.*"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
		<%
	     	request.setCharacterEncoding("utf-8");
			String sno = request.getParameter("sno");
			try{
			Class.forName("com.mysql.jdbc.Driver");
			String url = "jdbc:mysql://localhost:3306/st?useUnicode=true&characterEncoding=utf-8";
			String user = "root";
			String pass = "123456";
			Connection con = DriverManager.getConnection(url, user, pass);
			PreparedStatement ps = 	con.prepareStatement("delete from student2 where sno=?");
		    ps.setString(1, sno);
		    ps.executeUpdate();
		    ps.close();
		    con.close();
		    request.getRequestDispatcher("showinfo1.jsp").forward(request, response);
			} catch (ClassNotFoundException e) {
				e.printStackTrace();
			} catch (SQLException e) {
				e.printStackTrace();
			} 
		%>
</body>
</html>